<div class="maintop">
	当前位置：添加充值通道
	<a href="javascript:;" action="<?=$basepath?>" class="mainFrame button">返回</a>
	<a href="javascript:;" action="<?=$basepath?>_edit?id=<?=$data['id']?>" class="mainFrame button">刷新</a>
</div>
<div id="mainbody">
    <div class="main">
        <form name="add_save" action="<?=$basepath?>_edit_save" method="POST" target="ajax" func="form_submit">
            <div style="display:none;" class="hiddencontentdiv"><textarea id="hiddencontent" name="hiddencontent"></textarea></div>
            <? $this->display('editor',array('textareaid'=>'hiddencontent','uploadbutton'=>'uploadbutton','inputid'=>'logo','loadjsandcss'=>true)); ?>
		    <input type="hidden" name="id" value="<?=$data['id']?>" />
            <div class="info">
                <div id="infos1">
					<dl><dt>通道标题：</dt><dd><input type="text" name="title" class="int" value="<?=$data['title']?>" /></dd></dl>
                    <dl><dt>通道类名：</dt><dd><input type="text" name="payclass" class="int" value="<?=$data['payclass']?>" /></dd></dl>
                    <dl><dt>通道简名：</dt><dd><input type="text" name="info" class="int" value="<?=$data['info']?>" /></dd></dl>
                    <dl><dt>通道图标：</dt><dd><input type="text" name="logo" id="logo" class="wtxt" value="<?=$data['logo']?>" /></dd><dd><input type="button" name="uploadbutton" id="uploadbutton" value="选择" /></dd></dl>
                    <dl><dt>通道说明：</dt><dd><input type="text" name="memo" class="wtxt" value="<?=$data['memo']?>" /></dd></dl>
                    <dl><dt>状态：</dt><dd><select name="state">
                                <option value="0"<?=(intval($data['state'])==0 ? 'selected="selected"' : '') ?>>禁用</option>
                                <option value="1"<?=(intval($data['state'])==1 ? 'selected="selected"' : '') ?>>启用</option>
                            </select></dd></dl>
                    <dl><dt>使用银行：</dt><dd class="bankslist" id="bankslist">
                            <input type="hidden" name="banks" value="" />
                            <?php foreach ($bankslist as $k=>$v){ ?>
                            <label><input type="checkbox" name="bankslist" id="bank_<?=$v['id']?>" value="<?=$v['id']?>"><?=$v['title']?></label>
                            <?php } ?>
                        </dd></dl>
                    <dl><dt>应用平台：</dt><dd><input type="text" name="payfrom" class="int" value="<?=$data['payfrom']?>"></dd><dd class="t">web =&gt; 网页,　app =&gt; APP应用,　mobile =&gt; 移动网页，用“,”分开</dd></dl>
                    <dl><dt>固定金额：</dt><dd><input type="text" name="rechargemoney" class="int" value="<?=$data['rechargemoney']?>"></dd><dd class="t">允许支付金额：0不限制，金额间用“,”分开</dd></dl>
                    <dl><dt>排序：</dt><dd><input type="number" name="sort" class="int" value="<?=$data['sort']?>" /></dd><dd class="t">按5,4,3,2,1的倒序排序</dd></dl>
                    <dl><dt>&nbsp;</dt>
                    <dd>
                        <input type="submit" value="确认" class="btnbig" />
                        <a href="javascript:;" action="<?=$basepath?>" class="mainFrame btnbig">返回</a>
                    </dd></dl>
                </div>
		    </div>

        </form>
	</div>
</div>
<script type="text/javascript">
    $(document).ready(function(){
        $("input[name=bankslist]").on("click",function (e) {
            var _selectId = "";
            var arrChk=$("input[name=bankslist]:checked");
            $(arrChk).each(function(){
                _selectId += ',' + this.value;
            });
            _selectId = _selectId.substr(1,_selectId.length-1);
            $("input[name=banks]").val(_selectId);
        });

        <?php if(!empty($data['banks'])){
            $banks = explode(',', $data['banks']);
            foreach($banks as $k=>$v) {
                echo '$("#bank_' . $v . '").attr("checked", "checked");';
            }
        } ?>

    });

</script>

